import request from '@/utils/request'

/**
 * 查询Cube列表
 * @returns Cube
 */
export function listCube() {
  return request({
    url: "/model/listCube.action",
    method: 'get'
  });
}


export function pageCube(key, pageIndex, pageRows) {
  return request({
    url: key === "" || key === null ? `/model/pageCube.action?key=&pageIndex=${pageIndex}&pageRows=${pageRows}` : `/model/pageCube.action?key=${key}&pageIndex=${pageIndex}&pageRows=${pageRows}`,
    method: 'get'
  });
}

export function saveCube(data) {
  return request({
    url: `/model/saveCube.action`,
    method: 'post',
    data: data
  });
}

export function updateCube(data) {
  return request({
    url: `/model/updateCube.action`,
    method: 'post',
    data: data
  });
}

export function deleteCube(id) {
  return request({
    url: `/model/delCube.action?cubeId=${id}`,
    method: 'get'
  });
}

export function getCube(id) {
  return request({
    url: `/model/getCube.action?cubeId=${id}`,
    method: 'get'
  });
}

export function treeCube(id) {
  return request({
    url: `/model/treeCube.action?cubeId=${id}`,
    method: 'get'
  });
}
